package com.tm.userserver.controller;


import com.tm.commonutils.dto.OrderDTO;
import com.tm.commonutils.model.OrderModel;
import com.tm.commonutils.utils.R;
import com.tm.userserver.client.OrderClient;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("user1")
public class UserController {

    @Resource
    private OrderClient orderClient;

    @GetMapping("getUserTest")
    public String getUserTest(){
        String orderTest = orderClient.getOrderTest();


//        R<List<OrderModel>> list = orderClient.list();
//        R haha = orderClient.save(new OrderDTO(11L, "haha"));
//        R<OrderModel> order = orderClient.order(11L);
//        R haha1111 = orderClient.updateById(new OrderDTO(11L, "haha1111"));
//        R r = orderClient.delByOrderId(11L);
        return "这就是用户服务 ::::" + orderTest;
    }
}
